package com.qfjy.homework.ztx;

/**
 * @Author: 25348
 * @Date: 2023/6/29 20:00
 * @Project: java-2301-opensource-linux
 */
public class ProxyImage implements Image{

    private RealImage realImage;
    private String fileName;

    public ProxyImage(String fileName){
        this.fileName = fileName;
    }

    @Override
    public void display() {
        if(realImage == null){
            realImage = new RealImage(fileName);
        }
        realImage.display();
    }
}
